from django.db.models import F,Q
from django.http import HttpResponse
from .models import Book

def f_view(request):
    Book.objects.update(price=F('price') +100)
    return HttpResponse('f view')

def q_view(request):
    books = Book.objects.filter(Q(price__gte=80) | Q(rating__gte=9)).all()
    for book in books:
        print(book.name, book.price, book.rating)
    return HttpResponse('q view')
